<!DOCTYPE html><html lang="zh-CN" data-theme="light"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>BOM的主要内容 | ty'blog</title><meta name="author" content="lty123"><meta name="copyright" content="lty123"><meta name="format-detection" content="telephone=no"><meta name="theme-color" content="#ffffff"><meta property="og:type" content="article">
<meta property="og:title" content="BOM的主要内容">
<meta property="og:url" content="http://ekzodia_lty.gitee.io/tygame/2021/10/28/BOM%E7%9A%84%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9/index.html">
<meta property="og:site_name" content="ty&#39;blog">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://ekzodia_lty.gitee.io/tygame/img/coverImg/a8.jpg">
<meta property="article:published_time" content="2021-10-28T13:51:24.572Z">
<meta property="article:modified_time" content="2021-11-07T14:48:13.635Z">
<meta property="article:author" content="lty123">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://ekzodia_lty.gitee.io/tygame/img/coverImg/a8.jpg"><link rel="shortcut icon" href="/tygame/img/favicon.png"><link rel="canonical" href="http://ekzodia_lty.gitee.io/tygame/2021/10/28/BOM%E7%9A%84%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9/"><link rel="preconnect" href="//cdn.jsdelivr.net"/><link rel="preconnect" href="//busuanzi.ibruce.info"/><link rel="stylesheet" href="/tygame/css/index.css"><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free/css/all.min.css" media="print" onload="this.media='all'"><script>const GLOBAL_CONFIG = { 
  root: '/tygame/',
  algolia: undefined,
  localSearch: undefined,
  translate: undefined,
  noticeOutdate: undefined,
  highlight: {"plugin":"highlighjs","highlightCopy":true,"highlightLang":true,"highlightHeightLimit":false},
  copy: {
    success: '复制成功',
    error: '复制错误',
    noSupport: '浏览器不支持'
  },
  relativeDate: {
    homepage: false,
    post: false
  },
  runtime: '天',
  date_suffix: {
    just: '刚刚',
    min: '分钟前',
    hour: '小时前',
    day: '天前',
    month: '个月前'
  },
  copyright: undefined,
  lightbox: 'fancybox',
  Snackbar: undefined,
  source: {
    jQuery: 'https://cdn.jsdelivr.net/npm/jquery@latest/dist/jquery.min.js',
    justifiedGallery: {
      js: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/js/jquery.justifiedGallery.min.js',
      css: 'https://cdn.jsdelivr.net/npm/justifiedGallery/dist/css/justifiedGallery.min.css'
    },
    fancybox: {
      js: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.js',
      css: 'https://cdn.jsdelivr.net/npm/@fancyapps/fancybox@latest/dist/jquery.fancybox.min.css'
    }
  },
  isPhotoFigcaption: false,
  islazyload: true,
  isanchor: false
}</script><script id="config-diff">var GLOBAL_CONFIG_SITE = {
  title: 'BOM的主要内容',
  isPost: true,
  isHome: false,
  isHighlightShrink: false,
  isToc: true,
  postUpdate: '2021-11-07 22:48:13'
}</script><noscript><style type="text/css">
  #nav {
    opacity: 1
  }
  .justified-gallery img {
    opacity: 1
  }

  #recent-posts time,
  #post-meta time {
    display: inline !important
  }
</style></noscript><script>(win=>{
    win.saveToLocal = {
      set: function setWithExpiry(key, value, ttl) {
        if (ttl === 0) return
        const now = new Date()
        const expiryDay = ttl * 86400000
        const item = {
          value: value,
          expiry: now.getTime() + expiryDay,
        }
        localStorage.setItem(key, JSON.stringify(item))
      },

      get: function getWithExpiry(key) {
        const itemStr = localStorage.getItem(key)

        if (!itemStr) {
          return undefined
        }
        const item = JSON.parse(itemStr)
        const now = new Date()

        if (now.getTime() > item.expiry) {
          localStorage.removeItem(key)
          return undefined
        }
        return item.value
      }
    }
  
    win.getScript = url => new Promise((resolve, reject) => {
      const script = document.createElement('script')
      script.src = url
      script.async = true
      script.onerror = reject
      script.onload = script.onreadystatechange = function() {
        const loadState = this.readyState
        if (loadState && loadState !== 'loaded' && loadState !== 'complete') return
        script.onload = script.onreadystatechange = null
        resolve()
      }
      document.head.appendChild(script)
    })
  
      win.activateDarkMode = function () {
        document.documentElement.setAttribute('data-theme', 'dark')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#0d0d0d')
        }
      }
      win.activateLightMode = function () {
        document.documentElement.setAttribute('data-theme', 'light')
        if (document.querySelector('meta[name="theme-color"]') !== null) {
          document.querySelector('meta[name="theme-color"]').setAttribute('content', '#ffffff')
        }
      }
      const t = saveToLocal.get('theme')
    
          if (t === 'dark') activateDarkMode()
          else if (t === 'light') activateLightMode()
        
      const asideStatus = saveToLocal.get('aside-status')
      if (asideStatus !== undefined) {
        if (asideStatus === 'hide') {
          document.documentElement.classList.add('hide-aside')
        } else {
          document.documentElement.classList.remove('hide-aside')
        }
      }
    
    const detectApple = () => {
      if (GLOBAL_CONFIG_SITE.isHome && /iPad|iPhone|iPod|Macintosh/.test(navigator.userAgent)){
        document.documentElement.classList.add('apple')
      }
    }
    detectApple()
    })(window)</script><link rel="stylesheet" href="/tygame/css/custom.css"><link rel="preconnect" href="https://fonts.gstatic.com"><link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,300&display=swap" rel="stylesheet"><!-- hexo injector head_end start --><link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/Zfour/Butterfly-double-row-display@1.00/cardlistpost.min.css"/>
<style>#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags:before {content:"\A";
  white-space: pre;}#recent-posts > .recent-post-item >.recent-post-info > .article-meta-wrap > .tags > .article-meta__separator{display:none}</style>
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.4.0"></head><body><div id="loading-box"><div class="loading-left-bg"></div><div class="loading-right-bg"></div><div class="spinner-box"><div class="configure-border-1"><div class="configure-core"></div></div><div class="configure-border-2"><div class="configure-core"></div></div><div class="loading-word">加载中...</div></div></div><div id="web_bg"></div><div id="sidebar"><div id="menu-mask"></div><div id="sidebar-menus"><div class="avatar-img is-center"><img src= "" data-lazy-src="/tygame/img/avatar.jfif" onerror="onerror=null;src='/img/friend_404.gif'" alt="avatar"/></div><div class="site-data"><div class="data-item is-center"><div class="data-item-link"><a href="/tygame/archives/"><div class="headline">文章</div><div class="length-num">10</div></a></div></div><div class="data-item is-center"><div class="data-item-link"><a href="/tygame/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div></div><hr/><div class="menus_items"><div class="menus_item"><a class="site-page" href="/tygame/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div></div></div><div class="post" id="body-wrap"><header class="post-bg" id="page-header" style="background-image: url('/tygame/img/coverImg/a8.jpg')"><nav id="nav"><span id="blog_name"><a id="site-name" href="/tygame/">ty'blog</a></span><div id="menus"><div class="menus_items"><div class="menus_item"><a class="site-page" href="/tygame/"><i class="fa-fw fas fa-home"></i><span> 主页</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/archives/"><i class="fa-fw fas fa-archive"></i><span> 归档</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/tags/"><i class="fa-fw fas fa-tags"></i><span> 标签</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/categories/"><i class="fa-fw fas fa-folder-open"></i><span> 分类</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/link/"><i class="fa-fw fas fa-link"></i><span> 友情链接</span></a></div><div class="menus_item"><a class="site-page" href="/tygame/about/"><i class="fa-fw fas fa-heart"></i><span> 关于</span></a></div></div><div id="toggle-menu"><a class="site-page"><i class="fas fa-bars fa-fw"></i></a></div></div></nav><div id="post-info"><h1 class="post-title">BOM的主要内容</h1><div id="post-meta"><div class="meta-firstline"><span class="post-meta-date"><i class="far fa-calendar-alt fa-fw post-meta-icon"></i><span class="post-meta-label">发表于</span><time class="post-meta-date-created" datetime="2021-10-28T13:51:24.572Z" title="发表于 2021-10-28 21:51:24">2021-10-28</time><span class="post-meta-separator">|</span><i class="fas fa-history fa-fw post-meta-icon"></i><span class="post-meta-label">更新于</span><time class="post-meta-date-updated" datetime="2021-11-07T14:48:13.635Z" title="更新于 2021-11-07 22:48:13">2021-11-07</time></span><span class="post-meta-categories"><span class="post-meta-separator">|</span><i class="fas fa-inbox fa-fw post-meta-icon"></i><a class="post-meta-categories" href="/tygame/categories/JavaScript/">JavaScript</a></span></div><div class="meta-secondline"><span class="post-meta-separator">|</span><span class="post-meta-wordcount"><i class="far fa-file-word fa-fw post-meta-icon"></i><span class="post-meta-label">字数总计:</span><span class="word-count">484</span><span class="post-meta-separator">|</span><i class="far fa-clock fa-fw post-meta-icon"></i><span class="post-meta-label">阅读时长:</span><span>1分钟</span></span><span class="post-meta-separator">|</span><span class="post-meta-pv-cv" id="" data-flag-title="BOM的主要内容"><i class="far fa-eye fa-fw post-meta-icon"></i><span class="post-meta-label">阅读量:</span><span id="busuanzi_value_page_pv"></span></span></div></div></div></header><main class="layout" id="content-inner"><div id="post"><article class="post-content" id="article-container"><h2 id="BOM"><a href="#BOM" class="headerlink" title="BOM"></a>BOM</h2><h4 id="window对象"><a href="#window对象" class="headerlink" title="window对象"></a>window对象</h4><p>BOM的核心是window对象，控制窗口及弹窗</p>
<h5 id="窗口位置"><a href="#窗口位置" class="headerlink" title="窗口位置"></a><em>窗口位置</em></h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//窗口移动到左上角</span></span><br><span class="line"><span class="built_in">window</span>.moveTo(<span class="number">0</span>,<span class="number">0</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">//窗口向下移动100像素</span></span><br><span class="line"><span class="built_in">window</span>.moveBy(<span class="number">0</span>,<span class="number">100</span>);</span><br></pre></td></tr></table></figure>



<h5 id="调整窗口大小"><a href="#调整窗口大小" class="headerlink" title="调整窗口大小"></a><em>调整窗口大小</em></h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//窗口缩放到100 x 100，设置新的缩放宽度和高度</span></span><br><span class="line"><span class="built_in">window</span>.resizeTo(<span class="number">100</span>,<span class="number">100</span>)</span><br><span class="line"><span class="comment">//窗口缩放到 200 x 150，resizeBy 接收宽度和高度各要缩放多少</span></span><br><span class="line"><span class="built_in">window</span>.resizeBy(<span class="number">100</span>,<span class="number">50</span>)</span><br></pre></td></tr></table></figure>



<h5 id="视口位置（滚动条）"><a href="#视口位置（滚动条）" class="headerlink" title="视口位置（滚动条）"></a><em>视口位置（滚动条）</em></h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//滚动到页面左上角</span></span><br><span class="line"><span class="built_in">window</span>.scrollTo(<span class="number">0</span>,<span class="number">0</span>);</span><br><span class="line"><span class="built_in">window</span>.scrollBy(x,y);</span><br></pre></td></tr></table></figure>

<h5 id="打开新窗口"><a href="#打开新窗口" class="headerlink" title="打开新窗口"></a><em>打开新窗口</em></h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//用于导航到指定URL，也可以用于打开新的浏览器窗口</span></span><br><span class="line"><span class="built_in">window</span>.open(<span class="string">&quot;url&quot;</span>,<span class="string">&quot;已经存在的窗口名字&quot;</span>);</span><br><span class="line"><span class="comment">//单纯弹出一个窗口</span></span><br><span class="line"><span class="built_in">window</span>.open();</span><br><span class="line"><span class="comment">//open()里面有四个参数，参考《高级程序设计》P365</span></span><br></pre></td></tr></table></figure>



<h5 id="定时器也属于BOM-的windows对象-代码略"><a href="#定时器也属于BOM-的windows对象-代码略" class="headerlink" title="定时器也属于BOM 的windows对象(代码略)"></a><em>定时器也属于BOM</em> 的windows对象(代码略)</h5><h5 id="系统对话框"><a href="#系统对话框" class="headerlink" title="系统对话框"></a>系统对话框</h5><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">alert();</span><br><span class="line">confirm(); <span class="comment">//有确认和取消按钮</span></span><br><span class="line">prompt();<span class="comment">//输入一个值，会获得那个输入的值</span></span><br><span class="line"><span class="comment">//两个异步对话框</span></span><br><span class="line"><span class="built_in">window</span>.print();<span class="comment">//显示打印对话框</span></span><br><span class="line"><span class="built_in">window</span>.find();<span class="comment">//显示查找对话框</span></span><br></pre></td></tr></table></figure>



<h4 id="location对象"><a href="#location对象" class="headerlink" title="location对象"></a>location对象</h4><p>《高级程序设计》P372</p>
<p>查询字符串</p>
<figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">查询URL字符串</span></span><br><span class="line"><span class="comment">*/</span></span><br><span class="line"><span class="keyword">let</span> getQueryStringArgs = <span class="function"><span class="keyword">function</span> (<span class="params"></span>) </span>&#123;</span><br><span class="line">    <span class="keyword">let</span> qs = (location.search.length &gt; <span class="number">0</span> ? location.search.substring(<span class="number">1</span>) : <span class="string">&quot;&quot;</span>),</span><br><span class="line">    <span class="comment">//保存数据对象</span></span><br><span class="line">        args = &#123;&#125;;</span><br><span class="line">    <span class="comment">//把每个参数添加到 args 对象</span></span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">let</span> item <span class="keyword">of</span> qs.split(<span class="string">&quot;&amp;&quot;</span>).map(<span class="function"><span class="params">kv</span> =&gt;</span> kv.split(<span class="string">&quot;=&quot;</span>))) &#123;</span><br><span class="line">        <span class="keyword">let</span> name = <span class="built_in">decodeURIComponent</span>(item[<span class="number">0</span>]),</span><br><span class="line">            value = <span class="built_in">decodeURIComponent</span>(item[<span class="number">1</span>]);</span><br><span class="line">        <span class="keyword">if</span> (name.length) &#123;</span><br><span class="line">            args[name] = value;</span><br><span class="line">        &#125;</span><br><span class="line">    &#125;</span><br><span class="line">    <span class="keyword">return</span> args;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">//console.log(getQueryStringArgs);</span></span><br></pre></td></tr></table></figure>



<h4 id="navigator对象"><a href="#navigator对象" class="headerlink" title="navigator对象"></a>navigator对象</h4><p><strong>主要用于查询浏览器的属性</strong></p>
<p>检测浏览器是否安装了某个插件插件p376</p>
<p>注册处理程序p378</p>
<h4 id="screen对象"><a href="#screen对象" class="headerlink" title="screen对象"></a>screen对象</h4><p>浏览器窗口外面的客户端显示器的信息</p>
<h4 id="history对象"><a href="#history对象" class="headerlink" title="history对象"></a>history对象</h4><figure class="highlight js"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//后退一页</span></span><br><span class="line">history.go(-<span class="number">1</span>);</span><br><span class="line"><span class="comment">//前进一页</span></span><br><span class="line">history.go(<span class="number">1</span>);</span><br><span class="line"><span class="comment">//前进两页</span></span><br><span class="line">history.go(<span class="number">2</span>);</span><br><span class="line"><span class="comment">//导航到最近的 wrox.com 页面</span></span><br><span class="line">history.go(<span class="string">&quot;wrox.com&quot;</span>);</span><br><span class="line"><span class="comment">//go 有两个简写方法</span></span><br><span class="line">history.back();<span class="comment">//后退一页</span></span><br><span class="line">history.forward();<span class="comment">//前进一页</span></span><br></pre></td></tr></table></figure>




</article><div class="post-copyright"><div class="post-copyright__author"><span class="post-copyright-meta">文章作者: </span><span class="post-copyright-info"><a href="mailto:undefined">lty123</a></span></div><div class="post-copyright__type"><span class="post-copyright-meta">文章链接: </span><span class="post-copyright-info"><a href="http://ekzodia_lty.gitee.io/tygame/2021/10/28/BOM%E7%9A%84%E4%B8%BB%E8%A6%81%E5%86%85%E5%AE%B9/">http://ekzodia_lty.gitee.io/tygame/2021/10/28/BOM的主要内容/</a></span></div><div class="post-copyright__notice"><span class="post-copyright-meta">版权声明: </span><span class="post-copyright-info">本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank">CC BY-NC-SA 4.0</a> 许可协议。转载请注明来自 <a href="http://ekzodia_lty.gitee.io/tygame" target="_blank">ty'blog</a>！</span></div></div><div class="tag_share"><div class="post-meta__tag-list"></div><div class="post_share"><div class="social-share" data-image="/tygame/img/coverImg/a8.jpg" data-sites="phone,wechat,gitee,qq"></div><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/social-share.js/dist/css/share.min.css" media="print" onload="this.media='all'"><script src="https://cdn.jsdelivr.net/npm/social-share.js/dist/js/social-share.min.js" defer></script></div></div><nav class="pagination-post" id="pagination"><div class="prev-post pull-left"><a href="/tygame/2021/10/31/ts%E6%8E%A5%E5%8F%A3%E7%9A%84%E5%8F%AA%E8%AF%BB%E5%B1%9E%E6%80%A7%E5%92%8C%E5%8F%AF%E9%80%89%E5%B1%9E%E6%80%A7/"><img class="prev-cover" src= "" data-lazy-src="/tygame/img/coverImg/b3.jpg" onerror="onerror=null;src='/tygame/img/404.jpg'" alt="cover of previous post"><div class="pagination-info"><div class="label">上一篇</div><div class="prev_info">ts接口的只读属性和可选属性</div></div></a></div><div class="next-post pull-right"><a href="/tygame/2021/10/26/flex%E5%B8%83%E5%B1%80%E8%AE%A9%E6%9F%90%E4%B8%AA%E5%AD%90%E5%85%83%E7%B4%A0%E9%9D%A0%E5%8F%B3%E6%98%BE%E7%A4%BA/"><img class="next-cover" src= "" data-lazy-src="/tygame/img/coverImg/a7.jpg" onerror="onerror=null;src='/tygame/img/404.jpg'" alt="cover of next post"><div class="pagination-info"><div class="label">下一篇</div><div class="next_info">flex布局让某个子元素靠右显示</div></div></a></div></nav></div><div class="aside-content" id="aside-content"><div class="card-widget card-info"><div class="is-center"><div class="avatar-img"><img src= "" data-lazy-src="/tygame/img/avatar.jfif" onerror="this.onerror=null;this.src='/tygame/img/friend_404.gif'" alt="avatar"/></div><div class="author-info__name">lty123</div><div class="author-info__description"></div></div><div class="card-info-data"><div class="card-info-data-item is-center"><a href="/tygame/archives/"><div class="headline">文章</div><div class="length-num">10</div></a></div><div class="card-info-data-item is-center"><a href="/tygame/categories/"><div class="headline">分类</div><div class="length-num">6</div></a></div></div><a class="button--animated" id="card-info-btn" target="_blank" rel="noopener" href="https://gitee.com/ekzodia_lty"><i></i><span>关注我</span></a><div class="card-info-social-icons is-center"><a class="social-icon" href="/tygame/1219186777@qq.com" target="_blank" title="邮箱"><i class="fas fa-envelope"></i></a></div></div><div class="sticky_layout"><div class="card-widget" id="card-toc"><div class="item-headline"><i class="fas fa-stream"></i><span>目录</span></div><div class="toc-content"><ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#BOM"><span class="toc-number">1.</span> <span class="toc-text">BOM</span></a><ol class="toc-child"><li class="toc-item toc-level-4"><a class="toc-link" href="#window%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.1.</span> <span class="toc-text">window对象</span></a><ol class="toc-child"><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%AA%97%E5%8F%A3%E4%BD%8D%E7%BD%AE"><span class="toc-number">1.0.1.1.</span> <span class="toc-text">窗口位置</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%B0%83%E6%95%B4%E7%AA%97%E5%8F%A3%E5%A4%A7%E5%B0%8F"><span class="toc-number">1.0.1.2.</span> <span class="toc-text">调整窗口大小</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E8%A7%86%E5%8F%A3%E4%BD%8D%E7%BD%AE%EF%BC%88%E6%BB%9A%E5%8A%A8%E6%9D%A1%EF%BC%89"><span class="toc-number">1.0.1.3.</span> <span class="toc-text">视口位置（滚动条）</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E6%89%93%E5%BC%80%E6%96%B0%E7%AA%97%E5%8F%A3"><span class="toc-number">1.0.1.4.</span> <span class="toc-text">打开新窗口</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E5%AE%9A%E6%97%B6%E5%99%A8%E4%B9%9F%E5%B1%9E%E4%BA%8EBOM-%E7%9A%84windows%E5%AF%B9%E8%B1%A1-%E4%BB%A3%E7%A0%81%E7%95%A5"><span class="toc-number">1.0.1.5.</span> <span class="toc-text">定时器也属于BOM 的windows对象(代码略)</span></a></li><li class="toc-item toc-level-5"><a class="toc-link" href="#%E7%B3%BB%E7%BB%9F%E5%AF%B9%E8%AF%9D%E6%A1%86"><span class="toc-number">1.0.1.6.</span> <span class="toc-text">系统对话框</span></a></li></ol></li><li class="toc-item toc-level-4"><a class="toc-link" href="#location%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.2.</span> <span class="toc-text">location对象</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#navigator%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.3.</span> <span class="toc-text">navigator对象</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#screen%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.4.</span> <span class="toc-text">screen对象</span></a></li><li class="toc-item toc-level-4"><a class="toc-link" href="#history%E5%AF%B9%E8%B1%A1"><span class="toc-number">1.0.5.</span> <span class="toc-text">history对象</span></a></li></ol></li></ol></li></ol></div></div><div class="card-widget card-weibo"><div class="card-content"><div class="item-headline"><i class="fab fa-weibo"></i><span>微博热搜</span></div><div id="weibo-container" style="width: 100%; height: 150px;font-size: 95%;"></div></div></div><script defer="defer" data-pjax="data-pjax" src="https://cdn.jsdelivr.net/gh/Eurkon/CDN/hexo/js/card_weibo.js"></script><div class="card-widget card-recent-post"><div class="item-headline"><i class="fas fa-history"></i><span>最新文章</span></div><div class="aside-list"><div class="aside-list-item"><a class="thumbnail" href="/tygame/2021/11/20/%E5%89%8D%E7%AB%AF%E7%BC%93%E5%AD%98/" title="(转载)前端缓存"><img src= "" data-lazy-src="/tygame/img/coverImg/b1.jpg" onerror="this.onerror=null;this.src='/tygame/img/404.jpg'" alt="(转载)前端缓存"/></a><div class="content"><a class="title" href="/tygame/2021/11/20/%E5%89%8D%E7%AB%AF%E7%BC%93%E5%AD%98/" title="(转载)前端缓存">(转载)前端缓存</a><time datetime="2021-11-20T15:31:19.459Z" title="发表于 2021-11-20 23:31:19">2021-11-20</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/tygame/2021/11/19/%E5%88%86%E4%BC%97%E4%BC%A0%E5%AA%92H%E8%82%A1%E4%B8%8A%E5%B8%82%E5%85%AC%E5%91%8A%E8%A6%81%E7%82%B9%E8%A7%A3%E8%AF%BB/" title="(转载)分众传媒H股上市公告要点解读"><img src= "" data-lazy-src="/tygame/img/coverImg/b3.jpg" onerror="this.onerror=null;this.src='/tygame/img/404.jpg'" alt="(转载)分众传媒H股上市公告要点解读"/></a><div class="content"><a class="title" href="/tygame/2021/11/19/%E5%88%86%E4%BC%97%E4%BC%A0%E5%AA%92H%E8%82%A1%E4%B8%8A%E5%B8%82%E5%85%AC%E5%91%8A%E8%A6%81%E7%82%B9%E8%A7%A3%E8%AF%BB/" title="(转载)分众传媒H股上市公告要点解读">(转载)分众传媒H股上市公告要点解读</a><time datetime="2021-11-19T15:56:52.174Z" title="发表于 2021-11-19 23:56:52">2021-11-19</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/tygame/2021/11/07/%E7%AE%80%E5%8D%95%E7%9A%84%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81/" title="两个简单的防抖和节流"><img src= "" data-lazy-src="/tygame/img/coverImg/b5.jpg" onerror="this.onerror=null;this.src='/tygame/img/404.jpg'" alt="两个简单的防抖和节流"/></a><div class="content"><a class="title" href="/tygame/2021/11/07/%E7%AE%80%E5%8D%95%E7%9A%84%E9%98%B2%E6%8A%96%E5%92%8C%E8%8A%82%E6%B5%81/" title="两个简单的防抖和节流">两个简单的防抖和节流</a><time datetime="2021-11-07T14:43:45.535Z" title="发表于 2021-11-07 22:43:45">2021-11-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/tygame/2021/11/07/%E5%8D%9A%E5%AE%A2%E8%A3%85%E4%BF%AE%E5%9C%B0%E5%9B%BE/" title="博客装修地图"><img src= "" data-lazy-src="/tygame/img/coverImg/b1.jpg" onerror="this.onerror=null;this.src='/tygame/img/404.jpg'" alt="博客装修地图"/></a><div class="content"><a class="title" href="/tygame/2021/11/07/%E5%8D%9A%E5%AE%A2%E8%A3%85%E4%BF%AE%E5%9C%B0%E5%9B%BE/" title="博客装修地图">博客装修地图</a><time datetime="2021-11-07T14:39:38.851Z" title="发表于 2021-11-07 22:39:38">2021-11-07</time></div></div><div class="aside-list-item"><a class="thumbnail" href="/tygame/2021/10/31/git%E6%8C%87%E4%BB%A4/" title="git基础指令"><img src= "" data-lazy-src="/tygame/img/coverImg/a6.jpg" onerror="this.onerror=null;this.src='/tygame/img/404.jpg'" alt="git基础指令"/></a><div class="content"><a class="title" href="/tygame/2021/10/31/git%E6%8C%87%E4%BB%A4/" title="git基础指令">git基础指令</a><time datetime="2021-10-31T11:33:26.372Z" title="发表于 2021-10-31 19:33:26">2021-10-31</time></div></div></div></div></div></div></main><footer id="footer"><div id="footer-wrap"><div class="copyright">&copy;2019 - 2021 By lty123</div><div class="footer_custom_text">欢迎参观！！！</div></div></footer></div><div id="rightside"><div id="rightside-config-hide"><button id="readmode" type="button" title="阅读模式"><i class="fas fa-book-open"></i></button><button id="darkmode" type="button" title="浅色和深色模式转换"><i class="fas fa-adjust"></i></button><button id="hide-aside-btn" type="button" title="单栏和双栏切换"><i class="fas fa-arrows-alt-h"></i></button></div><div id="rightside-config-show"><button id="rightside_config" type="button" title="设置"><i class="fas fa-cog fa-spin"></i></button><button class="close" id="mobile-toc-button" type="button" title="目录"><i class="fas fa-list-ul"></i></button><button id="go-up" type="button" title="回到顶部"><i class="fas fa-arrow-up"></i></button></div></div><div><script src="/tygame/js/utils.js"></script><script src="/tygame/js/main.js"></script><script src="https://cdn.jsdelivr.net/npm/vanilla-lazyload/dist/lazyload.iife.min.js"></script><script>var preloader = {
  endLoading: () => {
    document.body.style.overflow = 'auto';
    document.getElementById('loading-box').classList.add("loaded")
  },
  initLoading: () => {
    document.body.style.overflow = '';
    document.getElementById('loading-box').classList.remove("loaded")

  }
}
window.addEventListener('load',preloader.endLoading())</script><div class="js-pjax"></div><script src="/tygame/js/custom.js"></script><script id="canvas_nest" defer="defer" color="200,0,127" opacity="0.7" zIndex="-1" count="200" mobile="false" src="https://cdn.jsdelivr.net/npm/butterfly-extsrc@1/dist/canvas-nest.min.js"></script><script async data-pjax src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script></div><!-- hexo injector body_end start --> <script data-pjax>if(document.getElementById('recent-posts') && (location.pathname ==='/tygame/'|| '/tygame/' ==='all')){
    var parent = document.getElementById('recent-posts');
    var child = '<div class="recent-post-item" style="width:100%;height: auto"><div id="catalog_magnet"><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/JavaScript/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  JavaScript (1)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/TypeScript/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  TypeScript (1)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/CSS/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  CSS (1)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/杂记/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  杂记 (2)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/金融相关/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  金融相关 (1)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><div class="magnet_item"><a class="magnet_link" href="http://ekzodia_lty.gitee.io/tygame/categories/其他/"><div class="magnet_link_context" style=""><span style="font-weight:500;flex:1">  其他 (3)</span><span style="padding:0px 4px;border-radius: 8px;"><i class="fas fa-arrow-circle-right"></i></span></div></a></div><a class="magnet_link_more"  href="http://ekzodia_lty.gitee.io/tygame/categories" style="flex:1;text-align: center;margin-bottom: 10px;">查看更多...</a></div></div>';
    console.log('已挂载magnet')
    parent.insertAdjacentHTML("afterbegin",child)}
     </script><style>#catalog_magnet{flex-wrap: wrap;display: flex;width:100%;justify-content:space-between;padding: 10px 10px 0 10px;align-content: flex-start;}.magnet_item{flex-basis: calc(33.333333333333336% - 5px);background: #f2f2f2;margin-bottom: 10px;border-radius: 8px;transition: all 0.2s ease-in-out;}.magnet_item:hover{background: #b30070}.magnet_link_more{color:#555}.magnet_link{color:black}.magnet_link:hover{color:white}@media screen and (max-width: 600px) {.magnet_item {flex-basis: 100%;}}.magnet_link_context{display:flex;padding: 10px;font-size:16px;transition: all 0.2s ease-in-out;}.magnet_link_context:hover{padding: 10px 20px;}</style>
    <style></style><!-- hexo injector body_end end --></body></html>